<!DOCTYPE html>
<html>
<head>
<title>group edit</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="../resources/css/styles.css" rel="stylesheet">
<link href="css/jquery-ui.css" rel="stylesheet">
<link href="../resources/css/datagrid.css" rel="stylesheet">
<script src="http://cdnjs.cloudflare.com/ajax/libs/json3/3.3.2/json3.min.js"></script>
<script src="../resources/component/template.min.js"></script>
<script type="text/javascript" src="../resources/component/jquery.js"></script>
<script type="text/javascript" src="../resources/component/jquery.dataset.js"></script>
<script type="text/javascript" src="external/common.js"></script>
<script type="text/javascript" src="../resources/component/jquery.datagrid.js"></script>
<script type="text/javascript" src="../resources/component/jquery.datatree.js"></script>
<script type="text/javascript" src="../resources/component/jquery.dropdown.js"></script>
 
</head>
<body>
<div> 
	<div>
	<input type="button" name="add" value="增加" />
	<input type="button" name="save" value="保存"/>
	</div>
	<div class="datagrid" id="paramsgrid" style="position:absolute;top:30px;left:0;right:0;bottom:0px;">
		<table>
			<thead>
				<tr style="height: 10px;">
					 <th>参数名</th>
					 <th>值</th>
					 <th>参数描述</th>
				</tr>
			</thead>
			<tbody></tbody>
			<tfoot></tfoot>
		</table>
	</div></div>
</body>
<script>
var  jsondata ={
		sqlid:"1005",
		key:"id",
		pageNo:1,
		pageSize:50,
		params:{},
		columns:[{field:"name",cls:"txt-l",edit:{type:"text"}},
		          {field:"value",cls:"txt-l",edit:{type:"text"}},
			 		{field:"paramdesc",cls:"txt-l",edit:{type:"text"}}
		         ]
};
var paramsgrid = $("#paramsgrid").DataGrid(jsondata);
paramsgrid.on("update", function(event, datas, metadatas, aggrs, response) {
	paramsgrid.open();
    alert("操作成功");
});
paramsgrid.open();
$("[name='add']").on("click",function(){
	var record ={};
	paramsgrid.dataset.addRecord(record);
});
$("[name='save']").on("click",function(){
	paramsgrid.dataset.save();
});


</script>
</html>